<% 
url = @area.new_record? ? admin_areas_path(level: @level) : admin_area_path(@area, level: @level)
%>

<%= simple_form_for [:admin, @area], url: url, :defaults => { :input_html => { :class => "form-control" } }, remote: true, html: {class: 'form-horizontal' } do |f| %>
  <fieldset>
    <legend><%= title %></legend>
    <%= f.association :country, label: '国家', prompt: "请选择" if @level == 'province' %>
    <%= f.association :province, label: '省份', prompt: "请选择" if @level == 'city' %>
    <%= f.input :name, label: '名称'  %>
    <%= f.input :code, label: '编码'  %>
    <%= f.button :wrapped, value: '提 交' %>
  </fieldset>
<% end %>
<%= javascript_include_tag "prevent_label.js" %>
